<template>
  <div class="index">
    <el-container>
      <el-header height="80px">
        <div class="header_Top">
          <h2>csdn后台管理</h2>
        </div>
        <div class="header_Bottom">
          <div>欢迎至尊会员:{{ $store.getters.getUser.username }}</div>
          <el-button type="danger" @click="layout" size="small">退出</el-button>
        </div>
      </el-header>
      <el-container>
        <el-aside width="260px">
          <v-nav></v-nav>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
import vNav from "../components/vnav.vue";
export default {
  data() {
    return {};
  },
  methods: {
    layout() {
      this.$store.dispatch("changeUserAction", false);
      //退出登录  删除本地存储
      this.$router.push("/login");
    },
  },
  components: { vNav },
};
</script>
<style lang="less" scoped>
.el-header {
  background-color: #e3f0f4;
  color: #356fbe;
  border: 1px solid #cfe2ea;
  line-height: 9vh;
  font-size: 20px;
  font-weight: bolder;
  max-height: 9vh;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.el-header .header_Bottom {
  height: 30px;
  line-height: 30px;
  display: flex;
  justify-content: center;
  flex-direction: column;
}

.el-container {
  max-height: 91vh;
}

.el-aside {
  background-color: #fff;
  color: #333;
  line-height: 200px;
  overflow: hidden;
  max-height: 91vh;
}

.el-main {
  background-color: white;
  color: #333;
  line-height: 60px;
  max-height: 91vh;
}
</style>